#include "ssbase/base_cfg.h"
#include <Windows.h>
#include <tchar.h>
#include <strsafe.h>
#include <crtdbg.h>


#define kMaxAssertStringSize 4096

void base_assert_w(const char* lpFile, int nLine, const wchar_t* lpMsg)
{
	wchar_t szAssertInfo[kMaxAssertStringSize];
	StringCchPrintfW(szAssertInfo, _countof(szAssertInfo), L"%S(%d) : %s", lpFile, nLine, lpMsg);
	::MessageBoxW(::GetActiveWindow(), szAssertInfo, L"Assert", MB_OK);
	_CrtDbgBreak();
}

void base_assert_a(const char* lpFile, int nLine, const char* lpMsg)
{
	char szAssertInfo[kMaxAssertStringSize];
	StringCchPrintfA(szAssertInfo, _countof(szAssertInfo), "%s(%d) : %s", lpFile, nLine, lpMsg);
	::MessageBoxA(::GetActiveWindow(), szAssertInfo, "Assert", MB_OK);
	_CrtDbgBreak();
}
